//
//  HelpMeBagBankListCell.m
//  MRBang
//
//  Created by 铅笔 on 16/5/9.
//  Copyright © 2016年 杭州易网新科技. All rights reserved.
//

#import "HelpMeBagBankListCell.h"

@interface HelpMeBagBankListCell ()

@property (nonatomic,strong) UILabel *label_bankName;
@property (nonatomic,strong) UILabel *label_Person;
@property (nonatomic,strong) UILabel *label_interestRate;

@property (nonatomic,strong) UIImageView *imageView_arrowRight;//右侧按钮

@end

@implementation HelpMeBagBankListCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initWithHelpMeBagBankListCellSubviews];
    }
    
    return self;
}

- (void) initWithHelpMeBagBankListCellSubviews
{
    //银行名字
    self.label_bankName = [[UILabel alloc] initWithFrame:CGRectMake(29*PROPORTION_WIDTH, 45*PROPORTION_WIDTH, 442*PROPORTION_WIDTH, 22*PROPORTION_WIDTH)];
    [self addSubview:self.label_bankName];
    self.label_bankName.textColor = COLOR_TEXT_132;
    self.label_bankName.font = [UIFont systemFontOfSize:Font_SIZE_24];
//    self.label_bankName.text = @"北京银行-";
    
    //who bag
    self.label_Person = [[UILabel alloc] initWithFrame:CGRectMake(self.label_bankName.right, self.label_bankName.y, 340*PROPORTION_WIDTH, 22*PROPORTION_WIDTH)];
    [self addSubview:self.label_Person];
    self.label_Person.textColor = COLOR_TEXT_0;
    self.label_Person.font = [UIFont systemFontOfSize:Font_SIZE_24];
//    self.label_Person.text = @"按揭房、抵押房专案";
    
    //interest Rate
    self.label_Person = [[UILabel alloc] initWithFrame:CGRectMake(self.label_bankName.right, self.label_bankName.y, 340*PROPORTION_WIDTH, 22*PROPORTION_WIDTH)];
    [self addSubview:self.label_Person];
    self.label_Person.textColor = COLOR_TEXT_132;
    self.label_Person.font = [UIFont systemFontOfSize:Font_SIZE_24];
//    self.label_Person.text = @"月利率:0.86%";
    
    //箭头
    self.imageView_arrowRight = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth-40*PROPORTION_WIDTH,self.label_bankName.y-3, 30*PROPORTION_WIDTH, 32*PROPORTION_WIDTH)];
    [self addSubview:self.imageView_arrowRight];
    self.imageView_arrowRight.image = [UIImage imageNamed:@"return_right"];
    
    //横线
    UIView *view_line  = [[UIView alloc] initWithFrame:CGRectMake(0,115*PROPORTION_WIDTH,kScreenWidth,20.0*PROPORTION_WIDTH)];
    [self addSubview:view_line];
    view_line.backgroundColor = RXDColor(243, 245, 246);
}

- (void) layoutSubviews
{
    self.label_bankName.text = self.model_bagBankList.name;
    
    NSDictionary *dic_temp = (NSDictionary *)self.model_bagBankList.limitmin;
    
    NSRange range = [dic_temp[@"qishu1"] rangeOfString:@","];//匹配得到的下标
    
//     NSLog(@"limut  %@",[dic_temp[@"qishu1"] substringFromIndex:range.location+1]);
    
    self.label_Person.text = [NSString stringWithFormat:@"月利率:%@％",[dic_temp[@"qishu1"] substringFromIndex:range.location+1]];
}

@end
